import request from '@/utils/request'

const api = {
  userFind: '/comdesk_user/get_users',
  userAdd: '/smuser/add',
  userUpdate: '/smuser/update',
  userLogout: '/smuser/logout',
  userChangeRole: '/comdesk_user/changeuserrole',
}

export function userFind(data) {
  return request({
    url: api.userFind,
    method: 'post',
    data,
  })
}

export function userAdd(data) {
  return request({
    url: api.userAdd,
    method: 'post',
    data,
  })
}

export function userUpdate(data) {
  return request({
    url: api.userUpdate,
    method: 'post',
    data,
  })
}

export function userLogout(pkUser) {
  return request({
    url: `${api.userLogout}?pkUser=${pkUser}`,
    method: 'post',
  })
}

export function userChangeRole(data) {
  return request({
    url: api.userChangeRole,
    method: 'post',
    data,
  })
}
